package com.pktechan.api.enumeration;

/**
 * 产品种类
 */
public enum ProductCategoryEnum {

    WHITE_WINE(11, "白酒"),
    BEER(12, "啤酒"),
    WINE(13, "葡萄酒"),
    YELLOW_WINE(14, "黄酒"),
    REGISTER_VIP(21, "注册VIP"),
    REGISTER_DISTRIBUTOR(22, "注册配送商");

    private Integer code;
    private String name;

    ProductCategoryEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getNameByCode(Integer code) {
        for (ProductCategoryEnum orderTypeEnum : ProductCategoryEnum.values()) {
            if (orderTypeEnum.code.equals(code)) {
                return orderTypeEnum.name;
            }
        }
        return null;
    }
}
